package zheezes.eisp;

import java.util.Locale;

import org.apache.log4j.Logger;

public class LocaleProbe {
	private static Logger logger = Logger.getLogger(LocaleProbe.class);
	
	private static Locale locale = null;
	
	public static final synchronized Locale getLocale(String name) {
		if(locale != null) {
			return locale;
		}
		locale = name != null && name.length() != 0 ? new Locale(name) : Locale.getDefault();
		logger.info(String.format("name = %s, locale = %s", name, locale.toString()));
		return locale;
	}
}
